﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ADO.NET.Samples.Forms
{
    [Common.FormDescription("DataGridView Display Data of Related Table", "Demonstrate how to display data of a related table using DataGridView (Master/Detail).")]
    public partial class DataGridViewDisplayDataOfRelatedTable : Form
    {
        public DataGridViewDisplayDataOfRelatedTable()
        {
            InitializeComponent();
        }

        private void DataGridViewDisplayDataOfRelatedTable_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dBDataSet.Article' table. You can move, or remove it, as needed.
            this.articleTableAdapter.Fill(this.dBDataSet.Article);
            this.userTableAdapter.FillUsers(this.dBDataSet.User);

        }

        /// <summary>
        /// Cancel edit
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bindingNavigatorMovePreviousItem_Click(object sender, EventArgs e)
        {
            this.bindingSource1.CancelEdit();
        }
    }
}
